Diary 2024-12-26
patcon_ Hey @nishio this is so great! Mind if I get the link to the codebase? Trying to keep track of forks in https://patcon.github.io/polis-awesome and sharing on the Polis User Group discord, so that people can share more code and experience :) @nishio This is so great! May I get a link to the codebase so I can track the Polis fork on polis-awesome and share it on Discord in the Polis user group so people can share more code and experience:)
patcon_ And FYI the folks at @codefornl are working on a fork of the API that cleans up the REST interface, but still talks to the old DB. The idea is to detach from the old frontend, and make front ends generally more pluggable: FYI, the @codefornl folks are working on a fork of the API that will clean up the REST interface, but still communicate with the old DB. The idea is to decouple from the old front end and make the front end more pluggable in general
nishio Thank you for information! Here is my report and open data for this project: Thanks for the info! Here is my report and open data on this project
Detaching the frontend from DB and math server is very helpful!
Separating the front end from the DB and the math server helps a lot!
patcon_ Ah thank you so much! but I was also wondering about the fork of the http://pol.is codebase :) i saw that you at one point were pointing a script at a now hidden Polis API endpoint, so thought maybe you were involved in that with Yeah, thanks a lot! But I was also wondering about the pol.is codebase fork:) at some point I saw a script pointing to the now hidden Polis API endpoint, so maybe you are involved in that along with @Mielka_japan?
nishio Our project was a demonstration during the election period, developed within a few weeks, so we didn’t have time to fork and rewrite the Polis code. The frontend was built using Next.js and D3.js, utilizing the Polis server’s API for data retrieval and voting. Our project is an election-year demo and was developed in a few weeks, so there was no time to fork and rewrite the Polis code. The front end was built using Next.js and D3.js and uses the Polis server API for data retrieval and voting.
nishio The main objectives are to provide a user-friendly view for smartphone users and to make clusters more impactful by displaying party icons. The main objective is to provide a user-friendly view for smartphone users and to increase the impact of the cluster by displaying political party icons.
patcon_ Ah gotcha! So to make sure I understand: you guys just scraped the /api/v3/participationInit endpoint of your self-hosted vanilla polis instance (using your record_api repo scripts), then built that data into your nextjs app that runs http://japanchoice.jp... Oh, mess! Make sure I understand:.
You guys are scraping the /api/v3/participationInit endpoint (using your record_api repository script) of your self-hosted vanilla police instance and running that data japanchoice.jp Have you incorporated it into your nextjs app?
nishio Yes, your understanding is correct that we used the participationInit endpoint of a self-hosted vanilla instance. The record_api was used to log data hourly for post-analysis purposes and wasn’t directly involved in the main functionality of the web service, but the mechanism is Yes, your understanding that the participationInit endpoint of the self-hosted vanilla instance was used is correct. This record_api was used to record data hourly for post-hoc analysis purposes and was not directly involved in the main functionality of the web service, but the mechanism is the same.
patcon_ And that app borrows & customises some react components from the polis repo's client-participation viz, but that codebase is private at this time? Truly no pressure, but do you think your d3 customizations might be open sourced? (I am def not implying you need to, to be clear!) Also, that app is customized by borrowing some react components from the polis repository's client-participation viz, but its codebase is private at this time. No pressure really, but do you think the d3 customizations will be open source? (To clarify, I don't mean you have to!
patcon_ (And lastly, I assume the "party accounts" are just ones you operated yourselves in polis, and puppeted based on what your team agreed would likely be each party's responses? And I assume you ran tttc pieces periodically to generate group summaries? Sorry for all the Qs!) (Finally, do you think the "party accounts" were self-manipulated by the polices and manipulated based on what the team agreed to in each party's responses? And do you think they routinely ran tttc pieces to generate group summaries? Sorry for all the Q's!
nishio Thank you for your interest in our project! We welcome your questions and may update the README of the open data repository later on. Thank you for your interest in our project! We welcome your questions and may update the README for the Open Data Repository at a later date.
We didn't use the Polis client-side codebase at all. Our goal was to replace it with a mobile-friendly interface, and starting from scratch was easier than reusing the existing components. Since we already had a Next.js build process and components for other JAPAN CHOICE services, we leveraged those. This makes it challenging to decouple and share the code. We'll discuss with the team to see if there's anything we can share.
We did not use the Polis client-side code base at all. Our goal was to replace it with a mobile-friendly interface, and it was easier to start from scratch than to reuse existing components. We already had Next.js build processes and components for other JAPAN CHOICE services, so we took advantage of them. This made it difficult to separate and share code. We will discuss this with the team and see if there is anything we can share.
Regarding the "party accounts," those were opinion data we created based on each party's manifesto. Good point! We organized the data in a Google Spreadsheet, reviewed it collaboratively, and then used Microsoft Playwright for browser automation to input those into the Polis instance.
For the "Political Party Accounts", the opinion data was based on each party's manifesto. Good point! After organizing and collaboratively reviewing the data in a Google spreadsheet, we used Microsoft Playwright to automate the browser and populate the Polis instance.
As for generating group summaries, we took inspiration from TTTC but didn’t use it directly. Instead, we used ChatGPT to draft explanations. This process wasn't automated—humans used ChatGPT, reviewed the results by other people, and, once approved, updated the JSON data embedded in the service and deployed it.
For the generation of the group summary, we took inspiration from TTTC, but did not use it directly. Instead, we used ChatGPT to generate the description. This process was not automated; a human used ChatGPT, others reviewed the results, and once approved, updated and deployed the JSON data embedded in the service.
nishio Here was my memo on the development phase, using D3.js to create scatter plot and convex hull was quite easy! This is just a note from the development phase, but it was very easy to create scatter plots and convex hulls using D3.js.
----
---
This page is auto-translated from /nishio/日記2024-12-26 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.